<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:param name="path"/>

	<xsl:variable name="book" select="document('Book.xml')"/>
	
	
	<xsl:template match="/">
		<div id="root_id">
			<div id="header_id">
				header
			</div>
			<div id="body_id">
				<xsl:apply-templates select="BookPage"/>
			</div>
			<div id="footer">
				footer
			</div>
		</div>
	</xsl:template>


	<xsl:template match="@*|node()" mode="page-tree">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()" mode="page-tree"/>
		</xsl:copy>
	</xsl:template>
	
		
	<xsl:template match="BookPage">
		<xsl:element name="ol">
			<xsl:apply-templates select="$book/Book/TableOfContent/PageTree/*" mode="page-tree"/>
		</xsl:element>
		
		<xsl:element name="div">
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
	
</xsl:stylesheet>